Avoid weird behavior with large horizontal scrolls.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 4 Jul 2012 06:15:31 +0000 (23:15 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 4 Jul 2012 06:15:31 +0000 (23:15 -0700)
commit10f2cab331f822207980779a51d062e265e81f62
tree86bf6cb10c80fa3ab82213889952eb3d881c5544
parent5a33f16f72929015844bf86624ffa95101dc2b38
Avoid weird behavior with large horizontal scrolls.

Without this change, for example, large hscroll values would
mess up Emacs's display on Fedora 15 x86, presumably due to
overflows in int calculations in the display code.
Also, if buffers had long lines, Emacs would freeze.
* window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
(set_window_hscroll): New function, containing the old guts of
Fset_window_hscroll.  Return the clipped value.
(Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
This avoids the need to check against PTRDIFF_MAX.
src/ChangeLog
src/window.c